package com.gt.deceive.utils;

import com.sun.org.apache.xerces.internal.dom.PSVIAttrNSImpl;

/**
 * 生成手机号码
 */
public class CreateTelUtil {
    static String[] prefix_tel = {"134","135","136","137","138","139","150","151","152","157","158","159","147","182","183","184","187","188","130","131",
            "132","145","155","156","185","186","133","153","180","181","189"};

    public static int getNum(int start,int end) {
        return (int)(Math.random()*(end-start+1)+start);
    }

    /**
     * 生成手机号码
     * @return
     */
    public static String getTel(){
        int index=getNum(0,prefix_tel.length-1);
        String first=prefix_tel[index];
        String second=String.valueOf(getNum(1,888)+10000).substring(1);
        String third=String.valueOf(getNum(1,9100)+10000).substring(1);
        return first+second+third;
    }

    public static void main(String[] args) {
        for(int i=0;i<10;i++){
            System.out.println(getTel());
        }

    }
}
